package sh.wn36.vehiclemanage.service.service_cjl.impl_cjl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import sh.wn36.vehiclemanage.entity.PeccancyRecord;
import sh.wn36.vehiclemanage.entity.entity_cjl.Violation;
import sh.wn36.vehiclemanage.mapper.mapper_cjl.PeccancyRecordMapper;
import sh.wn36.vehiclemanage.service.service_cjl.PeccancyRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xk
 * @since 2021-04-26
 */
@Service
public class PeccancyRecordServiceImpl extends ServiceImpl<PeccancyRecordMapper, PeccancyRecord> implements PeccancyRecordService {

    @Autowired
    private PeccancyRecordMapper peccancyRecordMapper;

    @Override
    public IPage<Violation> listViolationByPage(Page<Violation> page,QueryWrapper<Violation> wrapper) {
        IPage<Violation> violations = peccancyRecordMapper.listViolation(page,wrapper);
        return violations;
    }

    @Override
    public PeccancyRecord findViolationByID(int id) {
        PeccancyRecord byId = peccancyRecordMapper.findById(id);
        return byId;
    }

    @Override
    public List<Map<String, Object>> reportList() {
        return peccancyRecordMapper.reportList();
    }

    @Override
    public List<Map<String, Object>> queryReportByCarId(Integer carId) {
        return peccancyRecordMapper.queryReportByCarId(carId);
    }

//    @Override
//    public Violation findViolationByID(int id) {
//        Violation violationsByID = peccancyRecordMapper.findViolationsByID(id);
//        return violationsByID;
//    }
}
